package com.wc.alorithm_blue_bridge._DFS.Q3820;

import java.io.*;

/**
 * @Author congege
 * @Description 混境之地5
 * https://www.lanqiao.cn/problems/3820/learning/?page=1&first_category_id=1
 * @Date Created in 2023/11/29-10:42
 */
public class Main {
    static int[][] positions = new int[][]{{-1,0},{0,-1},{1,0},{0,1}};
    static int n;
    static int m;
    static int k;
    static int[][] map;
    static int startX,startY;
    static int endX,endY;
    static boolean[][][] vis;

    public static void main(String[] args) {
        Input sc = new Input();
        n = sc.nextInt();
        m = sc.nextInt();
        k = sc.nextInt();
        int key = 1;
        map = new int[n][m];
        vis = new boolean[n][m][key + 1];
        startX = sc.nextInt() - 1;
        startY = sc.nextInt() - 1;
        endX = sc.nextInt() - 1;
        endY = sc.nextInt() - 1;
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                map[i][j] = sc.nextInt();
            }
        }
        vis[startX][startY][0] = true;
        vis[startX][startY][1] = true;
        boolean res = dfs(startX,startY,1);
        if(res){
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }

    public static boolean dfs(int x,int y,int key){
        if(x == endX && y == endY){
            return true;
        }
        boolean res = false;
        int nextX;
        int nextY;
        for(int[] position:positions){
            nextX = x + position[0];
            nextY = y + position[1];
            if(!isBound(nextX,nextY) && !vis[nextX][nextY][key]){
                vis[nextX][nextY][key] = true;
                if(map[nextX][nextY] < map[x][y]){
                    res |= dfs(nextX,nextY,key);
                } else if(key > 0 && map[nextX][nextY] < map[x][y] + k){
                    res |= dfs(nextX,nextY,key - 1);
                }
            }
        }
        return res;
    }

    public static boolean isBound(int x,int y){
        return x < 0 || x == n || y < 0 || y == m;
    }

    static class Input{
        StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));


        public int nextInt(){
            try {
                in.nextToken();
            } catch(Exception e){
                return -1;
            }
            return (int)in.nval;
        }
    }
}
